#!/usr/bin/python -O

import pymongo

<<<<<<< HEAD
dbclient = pymongo.MongoClient()
db = dbclient.stock
price = db.price

print dbclient, db, price

for p in price.find({'_id' : {'$regex' : r'_20140403$'}}):
    print p
=======
dbclient = pymongo.MongoClient('ccai')
db = dbclient.stock
price = db.price

for p in price.find({'_id' : {'$regex' : r'_20140403$'}}):
    print p['_id'][:6], p.get('last', 0), \
          p.get('open', 0), p.get('close', 0), p.get('ipc_p', 0), \
          p.get('high', 0), p.get('low', 0)
>>>>>>> 1f43e22c5ae3e3639ab82b7d2d6bbf2d80d9fdaa
